package cn.lijiguo.concurrency.part1.ch08;

/**
 * OtherService
 *
 * @author lijiguo
 * @date 2019/12/16 11:08
 */
public class OtherService {

    private final Object LOCK = new Object();

    private DeadLock deadLock;

    public void s1() {
        synchronized (LOCK) {
            System.out.println("s1===============");
        }
    }

    public void s2() {
        synchronized (LOCK) {
            System.out.println("s2===============");
            deadLock.m2();
        }
    }

    public void setDeadLock(DeadLock deadLock) {
        this.deadLock = deadLock;
    }
}
